<%@page import="java.util.Map"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.grom.po.Security"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html style="height:100%;width:100%;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Log in</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/js/themes/icon.css">
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.6.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.easyui.min.js"></script>
<style type="text/css">
#nav {
    background:-webkit-gradient(linear, 0 0, 0 100%, from(#E0ECFF), to(#cacaca));
    background:-moz-linear-gradient(top, #cacaca, #848484);
    -webkit-border-radius:3px;
    -moz-border-radius:3px;
    border-radius:3px;
    -webkit-box-shadow:0 1px 2px rgba(0,0,0,.3);
    display:inline-block;
    list-style:none;
    margin:0 0 5px;
    overflow:hidden;
    padding:0;
}
#nav li { border-right:1px solid #808080; -webkit-box-shadow:inset 0 0 0 1px rgba(255,255,255,.1); -moz-box-shadow:inset 0 0 0 1px rgba(255,255,255,.1); float:left; }
#nav li a { color:#262626; display:block; font:13px "Lucida Sans Unicode", "Lucida Grande", sans-serif; height:36px; line-height:34px; padding:0 30px; text-decoration:none; text-shadow:0 1px #cecece; }
#nav li a:hover { background:-webkit-gradient(linear, 0 0, 0 100%, from(#929292), to(#535353)); background:-moz-linear-gradient(top, #929292, #535353); -webkit-box-shadow:inset 0 -10px 20px rgba(0,0,0,.05), inset 0 0 0 1px rgba(255,255,255,.1); -moz-box-shadow:inset 0 -10px 20px rgba(0,0,0,.05), inset 0 0 0 1px rgba(255,255,255,.1); color:#fff; text-shadow:0 -1px #414141; }
#nav li a:active { -webkit-box-shadow:inset 0 -10px 20px rgba(0,0,0,.05), inset 0 2px 5px #363636, inset 0 0 0 1px rgba(255,255,255,.1); -moz-box-shadow:inset 0 -10px 20px rgba(0,0,0,.05), inset 0 2px 5px #363636, inset 0 0 0 1px rgba(255,255,255,.1); }
#nav li .current,
#nav li .current:hover { background:-webkit-gradient(linear, 0 0, 0 100%, from(#373737), to(#525051)); background:-moz-linear-gradient(top, #373737, #525051); -webkit-box-shadow:inset 0 -10px 20px rgba(0,0,0,.05), inset 0 2px 5px #363636, inset 0 0 0 1px rgba(255,255,255,.1); -moz-box-shadow:inset 0 -10px 20px rgba(0,0,0,.05), inset 0 2px 5px #363636, inset 0 0 0 1px rgba(255,255,255,.1); color:#fff; text-shadow:0 1px #242323; }
#nav .search_container { border-right:none; padding-right:5px; }
#nav .search { background:url(images/site-search-sprite.png) right -53px no-repeat; padding:7px 20px 8px 5px; }
#nav .search label { background:url(images/site-search-sprite.png) 0 0 no-repeat; display:block; height:20px; }
#nav .search input { border:none; color:#a9a9a9; height:12px; margin-left:25px; -webkit-appearance:none; }
#nav .search input:focus { border:none; outline:none; }
</style>
<script type="text/javascript">
</script>
</head>
<body>
<ul id="nav">
    <li><a href="#"><img src="<%=request.getContextPath() %>/css/logo.jpg"></a></li>
<%
	List<Security> rootModules = (List<Security>)request.getAttribute("rootModules");
	if(rootModules==null){
		rootModules = new ArrayList<Security>();
	}
	for(Security security : rootModules){
		%>
		<li><a href="<%=request.getContextPath() %>/FrameAction/changeDepart.do?SYSID=<%=security.getActionUrl() %>"><%=security.getSecurityName() %></a></li>
		<%
	}
%>
	<% 
		String SYSID = (String)request.getAttribute("SYSID"); 
		if(SYSID.equals("SALE")&&(rootModules==null||rootModules.size()==0)){
	%>
		<li><a href="<%=request.getContextPath() %>/FrameAction/changeDepart.do?SYSID=SALE"/>销售管理</a></li>
	<%
		}
	%>
    <li><a href="<%=request.getContextPath() %>/LoginAction/logOut.do">退出</a></li>
</ul>

<div id="systemManagement" class="easyui-layout" style="width:100%;height:600px;">  
    <div id="title_sys" name="title_sys" region="west" split="true" title="导航区" style="width:150px;">  
        <div id="saleDepartment" name="saleDepartment" class="easyui-accordion" fit="true" border="false" style="width:145px;height:550px;">  
	    <%
	    	Map<Security, List<Security>> userSecuritys = (Map<Security, List<Security>>)request.getAttribute("userSecuritys");
	    	for(Security parent : userSecuritys.keySet()){
	    %>
	    	<div title="<%=parent.getSecurityName() %>" iconCls="icon-ok" style="overflow:auto;padding:1px;">
	    		<% 
	    			List<Security> children = userSecuritys.get(parent);
	    			for(Security child : children){
	    		%>
	    			<p><a href="<%=request.getContextPath() %><%=child.getActionUrl() %>" target="main"><%=child.getSecurityName() %></a></p>
	    		<%
	    			}
	    		%>
	    	</div>
	    <%
	    	}
	    %>
	    	<div title="About system" iconCls="icon-reload" selected="true" style="padding:10px;">  
	        	 made by Grom
	    	</div>   
		</div>  
    </div>  
    <div id="content" region="center" title="数据区" style="padding:5px;">  
    	<iframe name="main" id="main" frameBorder="0" style="border: none;" width="100%" height="100%"></iframe>
    </div>  
</div>  


</body>
</html>